{extend name="normal_base" /}
{block name="navigation"}{/block}
{block name="css"}
<style>
    .title{
        width: 130px;
        color: #0f1315;
    }

    .layui-colla-title{
        font-weight:500;
    }

    .important-content {
        color: #FF5722;
    }

    .show-customer{
        cursor:pointer;
        color: #FF5722;
    }
</style>
{/block}
{block name="body"}
<div class="x-body">
    <div class="layui-collapse">
        <div class="layui-colla-item">
            <h2 class="layui-colla-title">基本信息</h2>
            <div class="layui-colla-content layui-show">
                <div class="layui-row">
                    <div class="layui-col-md4">
                        <div class="layui-inline title">合同编号：</div><div class="layui-inline">{$info.contract_number}</div>
                    </div>

                    <div class="layui-col-md4">
                        <div class="layui-inline title">年份：</div><div class="layui-inline">{$info.year}</div>
                    </div>

                    <div class="layui-col-md4">
                        <div class="layui-inline title">合同状态：</div><div class="layui-inline"><span class="important-content">{$info.status_desc}</span></div>
                    </div>
                </div>

                <div class="layui-row">
                    <div class="layui-col-md4">
                        <div class="layui-inline title">业务类型（大类）：</div><div class="layui-inline">{$info.class_name}</div>
                    </div>
                    <div class="layui-col-md4">
                        <div class="layui-inline title">业务类型（小类）：</div><div class="layui-inline">{$info.type_name}</div>
                    </div>

                    <div class="layui-col-md4">
                        <div class="layui-inline title">营销经理：</div><div class="layui-inline">{$info.sale_manager}</div>
                    </div>

                </div>

                <div class="layui-row">
                    <div class="layui-col-md4">
                        <div class="layui-inline title">项目名称：</div><div class="layui-inline">{$info.project_name}</div>
                    </div>
                    <div class="layui-col-md4">
                        <div class="layui-inline title">项目负责人：</div><div class="layui-inline">{$info.project_manager}</div>
                    </div>
                    <div class="layui-col-md4">
                        <div class="layui-inline title">合同金额：</div><div class="layui-inline">{$info.contract_amount}</div>
                    </div>
                </div>

                <div class="layui-row">
                    <div class="layui-col-md4">
                        <div class="layui-inline title">是否含税：</div><div class="layui-inline">{$info.is_include_tax ? '是' : '否'}</div>
                    </div>
                    <div class="layui-col-md4">
                        <div class="layui-inline title">合同领取人：</div><div class="layui-inline">{$info.contract_receiver}</div>
                    </div>

                    <div class="layui-col-md4">
                        <div class="layui-inline title">项目组：</div><div class="layui-inline">{if condition="isset($project_group_list[$info.project_group_id])"}{$project_group_list[$info.project_group_id]}{/if}</div>
                    </div>

                </div>
            </div>
        </div>
    </div>

    <div class="layui-collapse">
        <div class="layui-colla-item">
            <h2 class="layui-colla-title">客户信息</h2>
            <div class="layui-colla-content">
                <div class="layui-row">
                    <div class="layui-col-md4">
                        <div class="layui-inline title">客户名称：</div><div class="layui-inline">{$info.customer_name}（<span class="show-customer" onclick="x_admin_show('客户详情','{:url("customer/info")}?id={$info.customer_id}')">点击查看客户详情</span>）</div>
                    </div>

                </div>
            </div>
        </div>
    </div>

    <div class="layui-collapse">
        <div class="layui-colla-item">
            <h2 class="layui-colla-title">服务内容</h2>
            <div class="layui-colla-content">
                <div class="layui-row">
                    <textarea id="service-content" disabled style="display: none;">{:htmlspecialchars_decode($info.service_content)}</textarea>
                </div>
            </div>
        </div>
    </div>

    <div class="layui-collapse">
        <div class="layui-colla-item">
            <h2 class="layui-colla-title">合同扫描件</h2>
            <div class="layui-colla-content">
                <div class="layui-row">
                    {if condition="$info['scanning_file'] != ''"}
                    <span class="show-customer" onclick="show_scanning_file('{$info.scanning_file}')">点击查看</span>
                    {else/}
                    未上传...
                    {/if}
                </div>
            </div>
        </div>
    </div>

    <div class="layui-collapse">
        <div class="layui-colla-item">
            <h2 class="layui-colla-title">生命周期</h2>
            <div class="layui-colla-content">
                <div class="layui-row">
                    <ul class="layui-timeline">
                        {foreach name="$info['life_arr']" item="vo"}
                        <li class="layui-timeline-item">
                            <i class="layui-icon layui-timeline-axis"></i>
                            <div class="layui-timeline-content layui-text">
                                <h3 class="layui-timeline-title">{$vo.time} {$vo.title}</h3>
                                <p>
                                    操作人：{$vo.operator}<br>
                                    {$vo.content}
                                </p>
                            </div>
                        </li>
                        {/foreach}
                        <li class="layui-timeline-item">
                            <i class="layui-icon layui-timeline-axis"></i>
                            <div class="layui-timeline-content layui-text">
                                <h3 class="layui-timeline-title">{$info.create_time} 信息录入</h3>
                                <p>
                                    录入人：{$info.add_user_name}
                                </p>
                            </div>
                        </li>
                        <li class="layui-timeline-item">
                            <i class="layui-icon layui-timeline-axis"></i>
                            <div class="layui-timeline-content layui-text">
                                <div class="layui-timeline-title">过去</div>
                            </div>
                        </li>
                    </ul>
                </div>
            </div>
        </div>
    </div>
</div>

{/block}


{block name="script"}
<script>
    layui.use(['element', 'layedit'], function(){
        //var element = layui.element;
        var layedit = layui.layedit;
        var index = layedit.build('service-content',{
            tool: ['face', 'link','del','underline', '|', 'left', 'center', 'right']
            ,height: 300 //设置编辑器高度
        });


    });

    function show_scanning_file(url) {
        window.open(url);
    }
</script>
{/block}